<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../img/asset-favico.ico">
    <title>预约详情</title>
    <script src="../js/vue.js"></script>
    <script src="../js/axios-0.18.0.js"></script>
    <script src="../js/healthmobile.js"></script>
    <script>
        var id = getUrlParam("id");
    </script>
    <link rel="stylesheet" href="../css/page-health-orderDetail.css" />
</head>

<body data-spy="scroll" data-target="#myNavbar" data-offset="150">
    <div id="app">
        <!-- 页面头部 -->
        <div class="top-header">
            <span class="f-left" ><i class="icon-back" onclick="history.go(-1)"></i>返回</span>
            <span class="center">千锋健康</span>
            <span class="f-right"><i class="icon-more"></i></span>
        </div>
        <!-- 页面内容 -->
        <div class="contentBox">
            <div class="card">
                <div class="project-img">
                    <img src="../img/widget-detail.png" width="100%" height="100%" />
                </div>
                <div class="project-text">
                    <h4 class="tit">{{setmeal.name}}</h4>
                    <p class="subtit">{{setmeal.remark}}</p>
                    <p class="keywords"><span>{{setmeal.sex == '0' ? '性别不限' : setmeal.sex == '1' ? '男':'女'}}</span>
                        <span>{{setmeal.age}}</span></p>
                </div>
                <div class="project-know">
                    <a href="health-orderNotice.html" class="link-page">
            <i class="icon-ask-circle"><span class="path1"></span><span class="path2"></span></i>
            <span class="word">预约须知</span>
            <span class="arrow"><i class="icon-rit-arrow"></i></span>
        </a>
                </div>
            </div>
            <div class="table-listbox">
                <div class="box-title">
                    <i class="icon-zhen"><span class="path1"></span><span class="path2"></span></i>
                    <span>套餐详情</span>
                </div>
                <div class="box-table">
                    <div class="table-title">
                        <div class="tit-item flex2">项目名称</div>
                        <div class="tit-item  flex3">项目内容</div>
                        <div class="tit-item  flex3">项目解读</div>
                    </div>
                    <div class="table-content">
                        <ul class="table-list">
                            <li class="table-item" v-for="checkgroup in setmeal.checkGroupList">
                                <div class="item flex2">{{checkgroup.name}}</div>
                                <div class="item flex3">
                                    <label v-for="checkitem in checkgroup.checkItemList">
                                        {{checkitem.name}}
                                    </label>
                                </div>
                                <div class="item flex3">{{checkgroup.remark}}</div>
                            </li>
<!--                            <li class="table-item">-->
<!--                                <div class="item flex2">内科检查</div>-->
<!--                                <div class="item flex3">病史、家族史、病例、心率、心律、心音、肺部其他</div>-->
<!--                                <div class="item flex3">检查心肺有无杂音，杂音性质，心肺是否规则肝脾是否增大</div>-->
<!--                            </li>-->
<!--                            <li class="table-item">-->
<!--                                <div class="item flex2">一般检查A</div>-->
<!--                                <div class="item flex3">身高、体重、体重指数、收缩压、舒张压</div>-->
<!--                                <div class="item flex3">了解身体基本信息判断是否肥胖、超重</div>-->
<!--                            </li>-->
<!--                            <li class="table-item">-->
<!--                                <div class="item flex2">一般检查A</div>-->
<!--                                <div class="item flex3">身高、体重、体重指数、收缩压、舒张压</div>-->
<!--                                <div class="item flex3">了解身体基本信息判断是否肥胖、超重</div>-->
<!--                            </li>-->
<!--                            <li class="table-item">-->
<!--                                <div class="item flex2">一般检查A</div>-->
<!--                                <div class="item flex3">身高、体重、体重指数、收缩压、舒张压</div>-->
<!--                                <div class="item flex3">了解身体基本信息判断是否肥胖、超重</div>-->
<!--                            </li>-->
                        </ul>
                    </div>
                    <div class="box-button">
                        <a :href="'health-orderInfo.html?id='+ this.id" class="order-btn" @click="toOrderInfo()">立即预约</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        function GetQueryString(name)
        {
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if(r!=null)return unescape(r[2]); return null;
        }
        var vue =new Vue({
            el:'#app',
            data:{
                imgUrl:null,
                setmeal:{},
                id:GetQueryString("id")
            },
            method:{
                toOrderInfo(){
                    window.location.href = "health-orderInfo.html?id=" + id;
                },
                // //返回
                // back(){
                //     window.location.href = "health-setmeal.html"
                // }
            },
            mounted(){
                //打开cookie携带开关
                axios.defaults.withCredentials = true;
                axios({
                    url:"http://localhost:81/setmeal/findById?id=" + id,
                    method: "post",
                    headers: {
                        //Bearer token的规范是：Authorization名称的头，值为Bearer空格+具体的jwt串
                        "Authorization": "Bearer " + localStorage.getItem("token"),
                    }
                }). then(resp =>{
                    let refreshToken = resp.headers.refresh_token;
                    if (refreshToken != null && refreshToken.length != 0) {
                        localStorage.setItem("token", refreshToken)
                    }
                    let res = resp.data;
                    if (res.code == 2000) {
                        //没有登录  -- 跳转到登录页面
                        location.href = "/pages/health-login.html"
                    } else if (res.code == 3000) {
                        //没有权限
                        alert(res.msg)
                    } else{
                        //访问数据成功
                        this.setmeal = resp.data.data;
                        this.imgUrl = '../img/' + this.setmeal.img;
                    }
                })
                // axios.post("http://localhost:81/setmeal/findById?id=" + id).then((response) => {
                //     if(response.data.flag){
                //         this.setmeal = response.data.data;
                //         this.imgUrl = '../img/' + this.setmeal.img;
                //     }
                // });
            }
        })
    </script>
    <!-- 页面 css js -->


</body>